﻿using System;
using System.Collections.Generic;
using System.Text;

namespace NVR.DALSqlProvider
{
    public class DALSqlFactory:NVR.DALFactory.DALFactory
    {
        public override NVR.IDAL.IDALDeviceInfo DALDeviceInfoProvider
        {
            get
            {
                DALSqlProvider.DALDeviceInfoSqlProvider obj = System.Web.HttpContext.Current.Cache.Get("NVR.IDAL.IDALDeviceInfo") as DALSqlProvider.DALDeviceInfoSqlProvider;
                if (obj == null)
                {
                    var instance = new DALSqlProvider.DALDeviceInfoSqlProvider();

                    System.Web.HttpContext.Current.Cache.Add("NVR.IDAL.IDALDeviceInfo", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }

        public override NVR.IDAL.IDALNVRDeviceInfo DALNVRDevInfoProvider
        {
            get {
                DALSqlProvider.DALNVRDeviceInfoSqlProvider obj = System.Web.HttpContext.Current.Cache.Get("NVR.IDAL.IDALNVRDeviceInfo") as DALSqlProvider.DALNVRDeviceInfoSqlProvider;
                if (obj == null)
                {
                    var instance = new DALSqlProvider.DALNVRDeviceInfoSqlProvider();
                    System.Web.HttpContext.Current.Cache.Add("NVR.IDAL.IDALNVRDeviceInfo", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }
        public override NVR.IDAL.IDALUserInfo DALUserInfoProvider
        {
            get
            {
                DALSqlProvider.DALUserInfoSqlProvider obj = System.Web.HttpContext.Current.Cache.Get("NVR.IDAL.IDALUserInfo") as DALSqlProvider.DALUserInfoSqlProvider;
                if (obj == null)
                {
                    var instance = new DALSqlProvider.DALUserInfoSqlProvider();
                    System.Web.HttpContext.Current.Cache.Add("NVR.IDAL.IDALUserInfo", instance, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                    return instance;
                }
                return obj;
            }
        }
    }
}
